/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package logica.cliente;

/**
 *
 * @author Abel Ricardo
 */
import java.net.*;
import java.util.Enumeration;
public class DireccionesIP {
   public static void main(String[] args) throws SocketException{
   
        NetworkInterface ni = NetworkInterface.getByName("eth0");
        Enumeration<InetAddress> inetAddresses =  ni.getInetAddresses();


        while(inetAddresses.hasMoreElements()) {
            InetAddress ia = inetAddresses.nextElement();
            if(!ia.isLinkLocalAddress()) {
                System.out.println("IP: " + ia.getHostAddress());
            }
        }
      
      
   }
}
